Fair Solution to the Reader-Writer-Problem with Semaphores only

نویسنده

  • H. Ballhausen
چکیده

The reader-writer-problem is a standard problem in concurrent programming. A resource is shared by several processes which need either inclusive reading or exclusive writing access. The known solutions to this problem typically involve a number of global counters and queues. Here a very simple algorithm is presented which needs only two semaphores for synchronisation and no other global objects. The approach yields a fair solution without starving. The reader-writer-problem Assume the following situation: a shared resource, say a database, is accessed by several concurrent processes for reading or writing. Because the readers do not change the database, any number of them may be granted simultaneous access. On the other hand, only one writer is allowed to modify the database at a time.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Faster Fair Solution for the Reader-Writer Problem

A fast fair solution for Reader-Writer Problem is presented.

متن کامل

Faster Approximate Agreement with Multi-Writer Registers

We consider the complexity of the wait-free approximate agreement problem in an asynchronous shared memory comprised of only single-bit multi-writer multi-reader registers. For real-valued inputs of magnitude at most s and a real-valued accuracy requirement " > 0 we show matching upper and lower bounds of (log(s=")) steps and shared registers. For inputs drawn from any xed nite range this is si...

متن کامل

Constant RMR Transformation to Augment Reader-Writer Locks with Atomic Upgrade/Downgrade Support

The reader-writer problem [1] seeks to provide a lock that protects some critical section of code for two classes of processes: readers and writers. Multiple readers can have access to the critical section simultaneously, but only one writer can have access to the critical section to the exclusion of all other processes. The difficulties in solving the reader-writer problem lie not only in deve...

متن کامل

A Turn Function Scheme Realized in the Asynchronous Single-Writer/Multi-reader Shared Memory Model

We consider a set of users wishing to receive a service in an asynchronous distributed system. Such users declare their wishes and then wait to gain admittance to be served. Except for the initial transient period, at least one user must be waiting to be served, and the system should be as fair as possible for users. A procedure that ensures such a situation is called a turn function. It can be...

متن کامل

An Efficient Solution to the Mutual Exclusion Problem Using Weak Semaphores

We present a simple solution to the mutual exclusion problem with no lockout that uses weak binary semaphores. Previously, Morris [4] presented a solution to this problem that uses three binary semaphores and two variable-size shared variables. A simpler solution was given in [5], where just two semaphores and two shared singlebit variables are used. (In some earlier versions, an incorrect one-...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره cs.DC/0303005  شماره 

صفحات  -

تاریخ انتشار 2003